<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link href="<?=domain?>static/style/manage.css" rel="stylesheet" type="text/css" />
<link href="<?=domain?>static/style/fancybox.css" rel="stylesheet" type="text/css" />
<link href="<?=domain?>static/style/datepicker.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?=domain?>static/scripts/core.js" charset="utf-8"></script>
<script type="text/javascript" src="<?=domain?>static/scripts/fancybox.js" charset="utf-8"></script>
<script type="text/javascript" src="<?=domain?>static/scripts/datepicker.js" charset="utf-8"></script>
<script type="text/javascript" src="<?=domain?>static/scripts/manage.js" charset="utf-8"></script>
<title><?=name?></title>
<body class="hoariness">
<div class="head">
	<div class="area">
		<div class="logo">12306抢票系统</div>
		<div class="parent">
			<div class="nav">
				<ul>
					<?php
						foreach($menu as $key=>$value){
							echo '<li><a href="'.domain.'index.php?c='.$value['child'][0]['controller'].'&a='.$value['child'][0]['method'].'" class="'.(stristr($value['controller'],$this->request['controller'])?'sel':'').'">'.$value['name'].'</a></li>';
						}
					?>
	    		</ul>
			</div>
			<div class="user">欢迎您&nbsp;<?=$name?>&nbsp;,<a href="<?=domain?>index.php?c=manage&a=out">【退出】</a></div>
		</div>
	</div>
	<div class="child">
		<div class="nav">
			<?php
				$controller=0;$method=0;
				foreach($menu as $k=>$v){
					if(stristr($v['controller'],$this->request['controller'])){
						$controller=$k;
						echo '<ul class="sel '.$v['controller'].'">';
					}else{
						echo '<ul class="'.$v['controller'].'">';
					}
					foreach($v['child'] as $key=>$value){
						if($value['method']==$this->request['method']&&$value['controller']==$this->request['controller']){
							$method=$key;
						}
						echo '<li class="'.$value['method'].'"><a href="'.domain.'index.php?c='.$value['controller'].'&a='.$value['method'].'">'.$value['name'].'</a></li>';
					}
					echo '</ul>';
				}
			?>
		</div>
		<div class="place">当前位置:<?=$menu[$controller]['name']?>&nbsp;>&nbsp;<?=$menu[$controller]['child'][$method]['name']?></div>
	</div>
</div>
<div class="work">
	<div class="form">
		<h3 class="reallynow">
           <span><?=$menu[$controller]['child'][$method]['name']?></span>
           <div class="x select">
	           	<a href="#"><label>默认排序</label><span></span></a>
	           	<ul>
				  <li<?=($order=='money'&&$rule=='desc'?' selected':'')?>><a href="<?=$basic?>&order=money&rule=desc">佣金从高到低排序</a></li>
				  <li<?=($order=='money'&&$rule=='asc'?' selected':'')?>><a href="<?=$basic?>&order=money&rule=asc">佣金从低到高排序</a></li>
				  <li<?=($order=='date'&&$rule=='asc'?' selected':'')?>><a href="<?=$basic?>&order=date&rule=asc">注册时间从先到后</a></li>
				  <li<?=($order=='date'&&$rule=='desc'?' selected':'')?>><a href="<?=$basic?>&order=date&rule=desc">注册时间从后到先</a></li>
				  <li><a href="<?=$basic?>">默认排序</a></li>
		   		</ul>
           </div>
		<form name="home" method="GET" action="<?=domain?>index.php" accept-charset="UTF-8">
  		<input type="hidden" name="c" value="member"/><input type="hidden" name="a" value="index"/>
           <div class="x m select">
           		<a href="#"><label>设置搜索条件</label><span></span></a>
           		<div class="box">
					<div class="line">
						<div class="a">时间:</div>
						<div class="b"><input type="text" name="date" value="<?=(isset($date)&&count($date)==2?$date[0].','.$date[1]:'');?>" size="23"/></div>
					</div>
		   			<div class="line">
		   				<div class="a">角色:</div>
		   				<div class="b">
		   					<label><input type="checkbox" name="role[]" value="1"<?=(!isset($role)||isset($role[1])?' checked':'')?>/><span>超级管理员</span></label>
		   					<label><input type="checkbox" name="role[]" value="2"<?=(!isset($role)||isset($role[2])?' checked':'')?>/><span>联盟会员</span></label>
		   					<label><input type="checkbox" name="role[]" value="0"<?=(!isset($role)||isset($role[0])?' checked':'')?>/><span>其他</span></label>
		   				</div>
		   			</div>
		   			<div class="line">
		   				<div class="a">状态:</div>
		   				<div class="b">
		   					<label><input type="checkbox" name="locked[]" value="0"<?=(!isset($locked)||isset($locked[0])?' checked':'')?>/><span>正常</span></label>
		   					<label><input type="checkbox" name="locked[]" value="1"<?=(!isset($locked)||isset($locked[1])?' checked':'')?>/><span>未激活</span></label>
		   					<label><input type="checkbox" name="locked[]" value="2"<?=(!isset($locked)||isset($locked[2])?' checked':'')?>/><span>禁止</span></label>
		   				</div>
		   			</div>
		   		</div>
           </div>
           <span class="s"><input type="text" name="search" value="<?=$search?>" size="13" maxlength="60" search="true"/></span>
           <div class="h select">
	           	<a href="#"><label>邮箱</label><input type="hidden" name="tab" value="mail" search="true"/><span></span></a>
	           	<ul>
			   	  <li tab="mail"<?=($tab=='mail'?' selected':'')?>><a href="#">邮箱</a></li>
				  <li tab="name"<?=($tab=='name'?' selected':'')?>><a href="#">姓名</a></li>
				  <li tab="phone"<?=($tab=='phone'?' selected':'')?>><a href="#">电话</a></li>
				  <li tab="card"<?=($tab=='card'?' selected':'')?>><a href="#">身份证</a></li>
		   		</ul>
           </div>
           <span class="b"><input type="submit" name="filter" value="搜索" class="yellow"/></span>
           </form>
        </h3>
		 <table class="fix">
			<thead>
				<tr>
					<th><input type="checkbox" name="all" value="" id="input_all"/></th>
					<th>邮箱</th>
					<th>所属角色</th>
					<th>访问次数</th>
					<th>最后IP</th>
					<th>注册时间</th>
					<th>状态</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<?php
					foreach($member as $key=>$value){
				?>
				<tr>
					<td><input type="checkbox" name="member[]" value="<?=$value['id']?>"/></td>
					<td><?=$value['user']?></td>
					<td><?=$role[$value['role']]['name']?></td>
					<td><?=$value['visits']?></td>
					<td><?=long2ip($value['ip'])?></td>
					<td><?=date('Y-m-d H:i:s',$value['date'])?></td>
					<td><?=$value['locked']==0?'正常':($value['locked']==1?'未激活':($value['locked']==2?'禁止':'错误'))?></td>
					<td>
						<a fancybox="width:500,height:220" href="<?=(domain.'index.php?c=member&a=edit&member='.$value['id'])?>">编辑</a>&nbsp;
						<a href="<?=(domain.'index.php?c=member&a=locked&member='.$value['id'])?>" action="RequestA" mixed="sub:{locked:<?=($value['locked']==2||$value['locked']==1?0:2)?>}"><?=($value['locked']==2||$value['locked']==1?'激活':'禁止')?></a>&nbsp;
					</td>
				</tr>
				<?php
					}
				?>
			</tbody>
		</table>
		<div class="batch">
			<span><label for="input_all">全选</label></span>
			<span><a href="<?=(domain.'index.php?c=member&a=lock&locked=2')?>" action="RequestBa">批量禁止</a></span>
			<span><a href="<?=(domain.'index.php?c=member&a=lock&locked=0')?>" action="RequestBa">激活</a></span>
		</div>
	</div>
	<div class="pagination"><?=$pagination?>&nbsp;&nbsp;<font>共<?=$total?>条记录</font></div>
</div>
<div class="footer">
	<div class="credits">Power by <a href="http://ticket.cnadlm.com" target="_blank">cnadlm</a></div>
	<div class="connect">
		<script src="http://s96.cnzz.com/stat.php?id=4920030&web_id=4920030" language="JavaScript">
	</div>
</div>
</body>
</html>
<script language="JavaScript" type="text/javascript">
 $('input[name="date"]').DatePicker({
	position:'bottom',
	calendars:2,
	mode:'range',
	onBeforeShow:function(){
		$('input[name="date"]').parents('.select').attr('lock','true');
	},
	onChange:function(formated){
		formated=formated.toString();
		if(formated.indexOf('1970-01-01')==-1){
			$('input[name="date"]').val(formated);
			$('input[name="date"]').DatePickerHide();
		}
	},
	onHide:function(){
		$('input[name="date"]').parents('.select').removeAttr('lock');
	}
});
</script>